/**
 * 判断平台
 * @returns 
 */
const getPlatform = () => {
	let platform = ''
	// #ifdef H5
	platform = "H5"
	// #endif

	// #ifdef MP-WEIXIN
	platform = "MP_WEIXIN"
	// #endif
	return platform
}


// console.log('uni.getSystemInfoSync()', uni.getSystemInfoSync())
// statusBarHeight
const getNavBarHeightInfo = () => {
	const systemInfo = uni.getSystemInfoSync()
	const statusBarHeight = systemInfo.statusBarHeight || 0 //状态栏高度
	let titleBarHeight = 0 //标题栏高度
	// #ifdef MP
	const {
		top,
		height
	} = uni.getMenuButtonBoundingClientRect()
	titleBarHeight = (top - statusBarHeight) * 2 + height //小程序计算得出来
	// #endif

	// #ifndef MP
	titleBarHeight = 40 //非小程序环境标题栏高度给个40
	// #endif

	return {
		statusBarHeight,
		titleBarHeight,
		navBarHeight: statusBarHeight + titleBarHeight

	}

}
// console.log('getNavBarHeightInfo()', getNavBarHeightInfo())
export default {
	isDevelopment: process.env.NODE_ENV === 'development',
	isProduction: process.env.NODE_ENV === 'production',
	platform: getPlatform(),
	isAndroid: uni.getSystemInfoSync().platform === 'android',
	isIos: uni.getSystemInfoSync().platform === 'ios',
	isDevtools: uni.getSystemInfoSync().platform === 'devtools',
	navBarHeightInfo: getNavBarHeightInfo()



}